//
//  WenZhangTableViewCell.m
//  XRSquare
//
//  Created by 穆相臣 on 2018/8/31.
//  Copyright © 2018年 UaenaMo. All rights reserved.
//

#import "WenZhangTableViewCell.h"

@interface WenZhangTableViewCell ()
{
    UIImageView * contentImage;
    UILabel * titleLabel;
    UILabel * contentLabel;
    UIView * line;
}
@end

@implementation WenZhangTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        contentImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, ScreenWidth - 20, 100)];
        contentImage.contentMode = UIViewContentModeScaleAspectFill;
        contentImage.clipsToBounds = YES;
        [self addSubview:contentImage];
        
        titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 120, ScreenWidth - 20, 20)];
        titleLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:titleLabel];
        
        contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 140, ScreenWidth - 20, 20)];
        contentLabel.font = [UIFont systemFontOfSize:12];
        contentLabel.textColor = [UIColor colorFromHexCode:@"b3b3b3"];
        [self addSubview:contentLabel];
        
        line = [[UIView alloc]initWithFrame:CGRectMake(10, 169, ScreenWidth - 20, 1)];
        line.backgroundColor = [UIColor colorFromHexCode:@"f3f3f3"];
        [self addSubview:line];
    }
    return self;
}

+(CGFloat)height
{
    return 170;
}

-(void)loadData:(NSDictionary *)data
{
    [contentImage sd_setImageWithURL:[NSURL URLWithString:[data objectForKey:@"PicOutSide"]]];
    titleLabel.text = [data objectForKey:@"Title"];
    contentLabel.text = [data objectForKey:@"Brief"];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
